/* 
 * This code contains copyright information which is the proprietary property of
 * hotels.com. No part of this code may be reproduced, stored or transmitted in
 * any form without the prior written permission of hotels.com.   
 * Copyright (C) hotels.com. 2006 
 * All rights reserved.
 */

package com.txtsqlclient.dataaccess.database.connection;

import com.txtsqlclient.dataaccess.database.DatabaseType;

/**
 * @author spadda
 */
public class ConnectionDetailsVO {

    private DatabaseType dbType;

    private String ip;

    private String database;

    private String user;

    private String password;

    /**
     * @return Returns the database.
     */
    public String getDatabase() {
        return this.database;
    }

    /**
     * @param database
     *            The database to set.
     */
    public void setDatabase(String database) {
        this.database = database;
    }

    /**
     * @return Returns the dbType.
     */
    public DatabaseType getDbType() {
        return this.dbType;
    }

    /**
     * @param dbType
     *            The dbType to set.
     */
    public void setDbType(DatabaseType dbType) {
        this.dbType = dbType;
    }

    /**
     * This method is required to set the Database Type, using the identifier string.
     * 
     * @param dbTypeId
     */
    public void setDbType(String dbTypeId) {
        this.dbType = DatabaseType.getDatabaseType(dbTypeId);
    }

    /**
     * @return Returns the ip.
     */
    public String getIp() {
        return this.ip;
    }

    /**
     * @param ip
     *            The ip to set.
     */
    public void setIp(String ip) {
        this.ip = ip;
    }

    /**
     * @return Returns the password.
     */
    public String getPassword() {
        return this.password;
    }

    /**
     * @param password
     *            The password to set.
     */
    public void setPassword(String password) {
        this.password = password;
    }

    /**
     * @return Returns the user.
     */
    public String getUser() {
        return this.user;
    }

    /**
     * @param user
     *            The user to set.
     */
    public void setUser(String user) {
        this.user = user;
    }

    /**
     * String representation of this object
     * 
     * @see java.lang.Object#toString()
     */
    public String toString() {
        StringBuffer buff = new StringBuffer();
        buff.append("[database type=")
                .append(this.dbType.getIdentifier())
                .append(", ip=")
                .append(this.ip)
                .append(", database=")
                .append(this.database)
                .append(", user=")
                .append(this.user)
                .append(", password=")
                .append(this.password)
                .append("]");
        return buff.toString();
    }
}
